import java.util.ArrayList;

public class Tset {
    public static void main(String[] args) {
        MyArraylist2 myArraylist2 = new MyArraylist2();
        myArraylist2.add(0,3);
        myArraylist2.add(1,9);
        myArraylist2.add(2,8);
        myArraylist2.add(3,37);
        myArraylist2.add(4,32);
        myArraylist2.display();
        System.out.println("=========================");
        myArraylist2.add(2,50);
        myArraylist2.display();
        myArraylist2.add(0,0);
        myArraylist2.display();
        System.out.println(myArraylist2.contains(0));
        System.out.println(myArraylist2.search(3));
        myArraylist2.add(50);
        myArraylist2.add(51);
        myArraylist2.add(52);
        myArraylist2.display();
        myArraylist2.del(9);
        myArraylist2.display();
      //  myArraylist2.claer();
        myArraylist2.display();
        System.out.println(myArraylist2.search(50));
        System.out.println(myArraylist2.getPos(5));

    }

    public static void main1(String[] args) {
        MyArraylist myArraylist = new MyArraylist();
        myArraylist.add(0,3);
        myArraylist.add(1,9);
        myArraylist.add(2,8);
        myArraylist.add(3,37);
        myArraylist.add(4,32);
        myArraylist.display();
        System.out.println(myArraylist.size());
        System.out.println("-------------------------------------");
//        myArraylist.update(3,27);        //修改下标为3的数据为27
//        myArraylist.display();
//        myArraylist.del(2);                   //删除下标为2的元素
//        System.out.println(myArraylist.isFull());   //判断线性表数据是否已满 返回true  false
//        System.out.println(myArraylist.size());    //获取线性表有效数据长度
//        myArraylist.display();
//        System.out.println("-------------------------------------");
//        System.out.println(myArraylist.contains(37));   //是否存在元素37
//        System.out.println(myArraylist.search(40));  //查找某个元素的下标，不存在返回-1
//        System.out.println(myArraylist.getPos(3));    //得到某下标对应的元素
        myArraylist.update(4,30);
        myArraylist.display();
        System.out.println("---------------------------------");
        myArraylist.del(4);
        myArraylist.display();
        System.out.println("-----------------------------------");
//        myArraylist.claer();
        myArraylist.del(30);
        myArraylist.del(3);
        myArraylist.display();

    }
}
